package com.jzlw.huozhuduan.network;



import com.jzlw.huozhuduan.network.httpservice.HttpMethods;

import java.util.List;

import io.reactivex.Observable;
import io.reactivex.observers.DisposableObserver;
import okhttp3.MultipartBody;
import okhttp3.ResponseBody;

public class CommonSubscribe {

    /**
     * 上传图片
     */
    public static void uploadPic(MultipartBody.Part partList, DisposableObserver<ResponseBody> subscriber) {
        Observable<ResponseBody> observable = HttpMethods.getInstance().getHttpApi().uploadPic(partList);
        HttpMethods.getInstance().toSubscribe(observable, subscriber);
    }

    public static void uploadPicList(List<MultipartBody.Part>partList, DisposableObserver<ResponseBody> subscriber) {
        Observable<ResponseBody> observable = HttpMethods.getInstance().getHttpApi().uploadPicList(partList);
        HttpMethods.getInstance().toSubscribe(observable, subscriber);
    }

}
